#include <cstdio>
#include <cstring>
#include <algorithm>
#include <queue>

using namespace std;

#define maxn 1010
#define inf (1 << 28)

struct Edge
{
    int u, v, c, f, w, next;
}e[210000];

int cnt;
int head[maxn], dis[maxn], visit[maxn], pos[maxn];

void addEdge(int u, int v, int c, int w)
{
    e[cnt].u = u, e[cnt].v = v, e[cnt].c = c, e[cnt].f = 0;
     e[cnt].w = w, e[cnt].next = head[u], head[u] = cnt++;
     e[cnt].u = v, e[cnt].v = u, e[cnt].c = 0, e[cnt].f = 0;
     e[cnt].w = -w, e[cnt].next = head[v], head[v] = cnt++;
}

void spfa(int s, int t, int ver)
{
    int i, j, u, v;
    for (i = 0; i <= ver; i++)
    {
        visit[i] = 0;
        dis[i] = -1;
        pos[i] = -1;
    }
    queue <int> que;
    que.push(s);
    dis[s] = 0;
    visit[s] = 1;
    while (!que.empty())
    {
        u = que.front();
        que.pop();
        visit[u] = 0;
        for (i = head[u]; i + 1; i = e[i].next)
        {
            v = e[i].v;
            if (e[i].c > e[i].f && dis[v] < dis[u] + e[i].w)
            {
                dis[v] = dis[u] + e[i].w;
                pos[v] = i;
                if (!visit[v])
                {
                    visit[v] = 1;
                    que.push(v);
                }
            }
        }
    }
}

int CostFlow(int s, int t, int ver)
{
    int i;
    int cost = 0, flow = 0, minf;
    while (1)
    {
        spfa(s, t, ver);
        if (dis[t] == -1)
        {
            break;
        }
        minf = inf;
        for (i = pos[t]; i != -1; i = pos[e[i].u])
        {
            minf = min(minf, e[i].c - e[i].f);
        }
        for (i = pos[t]; i != -1; i = pos[e[i].u])
        {
            e[i].f += minf, e[i^1].f -= minf;
        }
        flow += minf;
        cost += minf * dis[t];
    }
    return cost;
}

int n, m, k, sum;
bool flag;

int min( int a, int b ) { return ( a < b )?a :b; }
int max( int a, int b ) { return ( a > b )?a :b; }

void init( )
{
    int i, a[ 1001 ];
    sum = 0;
    for ( i = 0; i < n; i++ )
    {
        scanf("%d", &a[ i ]);
        sum += a[ i ];
    }
    if ( m <= k )
    {
        flag = true;
        return ;
    }
    cnt = 0;
    for ( i = 0; i <= n - m + 2; i++ ) head[ i ] = -1;
    for ( i = 0; i <= n - m + 1; i++ ) addEdge( i, i + 1, k, 0 );
    for ( i = 0; i < n; i++ ) addEdge( max( 1, i - m + 2 ), min( n - m + 1, i + 1 ) + 1, 1, a[ i ] );
}

int main( )
{
    while ( scanf("%d%d%d", &n, &m, &k) != EOF )
    {
        flag = false;
        init( );
        if ( flag )
        {
            printf("%d\n", sum);
            continue;
        }
        printf("%d\n", CostFlow( 0, n - m + 2, n - m + 3 ));
    }
    return 0;
}
